/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.xuexiang.xui_lib.component.banner.anim.select;

import ohos.agp.animation.AnimatorProperty;
import ohos.agp.components.Component;

import com.xuexiang.xui_lib.component.banner.anim.BaseAnimator;

/**
 * 缩放动画
 *
 * @since 2021-05-06
 */
public class ZoomInEnter extends BaseAnimator {
    private final int duration = 200;
    private final float scaleSize = 1.5f;

    /**
     * 默认构造参数
     * 设置动画事件200毫秒
     */
    public ZoomInEnter() {
        this.mDuration = duration;
    }

    @Override
    public void setAnimation(Component view) {
        AnimatorProperty animatorProperty = view.createAnimatorProperty();
        animatorProperty.scaleX(scaleSize).scaleY(scaleSize);
        animatorProperty.setDuration(mDuration);
        mAnimatorSet.runParallel(animatorProperty);
    }
}
